<template>
  <a-modal :visible="show" width="90vw" title="点评记录" :maskClosable="false" :key="show" @cancel="show = false">
    <CommentsListView ref="CommentsListView"/>
    <template slot="footer">
      <a-button @click="show = false"> 关闭 </a-button>
    </template>
  </a-modal>
</template>

<script>
import { TableMixin } from '@/mixins/TableMixin'
export default {
  name: 'TechnologyCommentModal',
  components: {
    CommentsListView: () => import('@/views/tech/enginee/comments/CommentsListView'),
  },
  mixins: [TableMixin],

  data() {
    return {
      show:false,
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          width: '45px',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '点评单号',
          align: 'center',
          width: '150px',
          dataIndex: 'commentNo',
          customCell: () => {
            return this.customCellRender(100)
          },
          customRender: (text, record) => {
            return this.tooltipRender(text, record)
          },
        },
        {
          title: '点评总分',
          align: 'center',
          width: '120px',
          dataIndex: 'score',
          customCell: () => {
            return this.customCellRender(120)
          },
          customRender: (text, record) => {
            return this.tooltipRender(text, record)
          },
        },
        {
          title: '点评意见',
          align: 'center',
          width: '300px',
          dataIndex: 'comments',
          customCell: () => {
            return this.customCellRender(120)
          },
          customRender: (text, record) => {
            return this.tooltipRender(text, record)
          },
        },
        {
          title: '评价人',
          align: 'center',
          width: '100px',
          dataIndex: 'userName',
          customCell: () => {
            return this.customCellRender(100)
          },
          customRender: (text, record) => {
            return this.tooltipRender(text, record)
          },
        },
        {
          title: '评价时间',
          align: 'center',
          width: '180px',
          dataIndex: 'commentsCreateTime',
          customCell: () => {
            return this.customCellRender(180)
          },
          customRender: (text, record) => {
            return this.tooltipRender(text, record)
          },
        },
      ],
      tech:{}
    }
  },
  computed: {},
  watch: {},
  mounted() {},
  methods: {
    open(tech) {
      this.show = true
      this.tech = tech
      this.$nextTick(()=>{
        this.$refs.CommentsListView.setColumns(this.columns)
        this.$refs.CommentsListView.setTechId(this.tech.id)
      })
    },
  },
}
</script>